﻿<Ui xmlns="http://www.blizzard.com/wow/ui/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.blizzard.com/wow/ui/
    ..\..\FrameXML\UI.xsd">

	<Frame name="PowaOptionsCpuFrame2" parent="UIParent">

	    <Scripts>
            <OnLoad>
                PowaOptionsCpuFrame2_OnLoad(self);
            </OnLoad>
        </Scripts>

		<Frames>
			
			<!-- Enable PA Checkbox -->
			<CheckButton name="PowaEnableButton" inherits="PowaCheckTemplate">
				<Size>
					<AbsDimension x="25" y="25"/>
				</Size>
				<Anchors>
				  <Anchor point="TOPLEFT"
						  relativeTo="PowaOptionsCpuFrame2"
						  relativePoint="TOPLEFT">
					<Offset>
					  <AbsDimension x="20"
									y="-15" />
					</Offset>
				  </Anchor>
			  </Anchors>
				<Scripts>
					<OnLoad>
						self.tooltipText = PowaAuras.Text.aideEnable;
						PowaEnableButtonText:SetText(PowaAuras.Text.nomEnable);
					</OnLoad>
					<OnClick>
						PowaAuras:EnableChecked();
					</OnClick>
				</Scripts>
			</CheckButton>
			
			<!-- Debug PA Checkbox -->
			<CheckButton name="PowaDebugButton" inherits="PowaCheckTemplate">
				<Size>
					<AbsDimension x="25" y="25"/>
				</Size>
				<Anchors>
			  <Anchor point="TOPLEFT"
					  relativeTo="PowaOptionsCpuFrame2"
					  relativePoint="TOPRIGHT">
				<Offset>
				  <AbsDimension x="-200"
								y="-15" />
				</Offset>
			  </Anchor>
			</Anchors>
				<Scripts>
					<OnLoad>
						self.tooltipText = PowaAuras.Text.aideDebug;
						PowaDebugButtonText:SetText(PowaAuras.Text.nomDebug);
					</OnLoad>
					<OnClick>
						PowaAuras:MiscChecked(self, "debug");
					</OnClick>
				</Scripts>
			</CheckButton>

			<CheckButton name="PowaTimerRoundingButton" inherits="PowaCheckTemplate">
				<Size>
					<AbsDimension x="25" y="25"/>
				</Size>
				<Anchors>
			  <Anchor point="TOPLEFT"
					  relativeTo="PowaEnableButton"
					  relativePoint="BOTTOMLEFT">
				<Offset>
				  <AbsDimension x="0"
								y="5" />
				</Offset>
			  </Anchor>
			</Anchors>				
				<Scripts>
					<OnLoad>
						self.tooltipText = PowaAuras.Text.aideTimerRounding;
						getglobal(self:GetName().."Text"):SetText(PowaAuras.Text.nomTimerRounding);
					</OnLoad>
					<OnClick>
						PowaAuras:MiscChecked(self, "TimerRoundUp");
					</OnClick>
				</Scripts>
			</CheckButton>

			<CheckButton name="PowaAllowInspectionsButton" inherits="PowaCheckTemplate">
				<Size>
					<AbsDimension x="25" y="25"/>
				</Size>
				<Anchors>
			  <Anchor point="TOPLEFT"
					  relativeTo="PowaDebugButton"
					  relativePoint="BOTTOMLEFT">
				<Offset>
				  <AbsDimension x="0"
								y="5" />
				</Offset>
			  </Anchor>
			</Anchors>				
				<Scripts>
					<OnLoad>
						self.tooltipText = PowaAuras.Text.aideAllowInspections;
						getglobal(self:GetName().."Text"):SetText(PowaAuras.Text.nomAllowInspections);
					</OnLoad>
					<OnClick>
						PowaAuras:MiscChecked(self, "AllowInspections");
					</OnClick>
				</Scripts>
			</CheckButton>
			

			<CheckButton name="PowaBlockIncomingAurasButton" inherits="PowaCheckTemplate">
				<Size>
					<AbsDimension x="25" y="25"/>
				</Size>
				<Anchors>
			  <Anchor point="TOPLEFT"
					  relativeTo="PowaTimerRoundingButton"
					  relativePoint="BOTTOMLEFT">
				<Offset>
				  <AbsDimension x="0"
								y="5" />
				</Offset>
			  </Anchor>
			</Anchors>				
				<Scripts>
					<OnLoad>
						self.tooltipText = PowaAuras.Text.aideBlockIncomingAuras;
						getglobal(self:GetName().."Text"):SetText(PowaAuras.Text.nomBlockIncomingAuras);
					</OnLoad>
					<OnClick>
						PowaAuras:GlobalMiscChecked(self, "BlockIncomingAuras");
					</OnClick>
				</Scripts>
			</CheckButton>
			
			
			<CheckButton name="PowaFixExportsButton" inherits="PowaCheckTemplate">
				<Size>
					<AbsDimension x="25" y="25"/>
				</Size>
				<Anchors>
			  <Anchor point="TOPLEFT"
					  relativeTo="PowaAllowInspectionsButton"
					  relativePoint="BOTTOMLEFT">
				<Offset>
				  <AbsDimension x="0"
								y="5" />
				</Offset>
			  </Anchor>
			</Anchors>				
				<Scripts>
					<OnLoad>
						self.tooltipText = PowaAuras.Text.aideFixExports;
						getglobal(self:GetName().."Text"):SetText(PowaAuras.Text.nomFixExports);
					</OnLoad>
					<OnClick>
						PowaAuras:GlobalMiscChecked(self, "FixExports");
					</OnClick>
				</Scripts>
			</CheckButton>
			
			
			
			<!-- Frequency auras are checked for updates -->
			<Slider name="PowaOptionsUpdateSlider2"
				  inherits="PowaBarSliderTemplate">
				<Size>
				  <AbsDimension x="580"
								y="16" />
				</Size>
				<Anchors>
				  <Anchor point="TOPLEFT"
						  relativeTo="PowaBlockIncomingAurasButton"
						  relativePoint="BOTTOMLEFT">
					<Offset>
					  <AbsDimension x="0"
									y="-10" />
					</Offset>
				  </Anchor>
				</Anchors>
				<Scripts>
				  <OnLoad>
					self:SetMinMaxValues(0,100); self:SetValue(100-200*PowaMisc.OnUpdateLimit); self:SetValueStep(1); 
					PowaOptionsUpdateSlider2Text:SetText(PowaAuras.Text.nomUpdateSpeed.." : "..self:GetValue().."%");
					PowaOptionsUpdateSlider2Low:SetText("0%"); 
					PowaOptionsUpdateSlider2High:SetText("100%");
				  </OnLoad>
				  <OnValueChanged>PowaAuras:PowaOptionsUpdateSliderChanged2(self);</OnValueChanged>
				</Scripts>
			</Slider>

			<!-- Frequency timers are updated -->
		  <Slider name="PowaOptionsTimerUpdateSlider2"
				  inherits="PowaBarSliderTemplate">
			<Size>
			  <AbsDimension x="580"
							y="16" />
			</Size>
			<Anchors>
			  <Anchor point="TOPLEFT"
					  relativeTo="PowaOptionsUpdateSlider2"
					  relativePoint="BOTTOMLEFT">
				<Offset>
				  <AbsDimension x="0"
								y="-20" />
				</Offset>
			  </Anchor>
			</Anchors>
			<Scripts>
			  <OnLoad>
				self:SetMinMaxValues(0,100); self:SetValue(100-1000*PowaMisc.AnimationLimit); self:SetValueStep(1); 
				PowaOptionsTimerUpdateSlider2Text:SetText(PowaAuras.Text.nomTimerUpdate.." : "..self:GetValue().."%");
				PowaOptionsTimerUpdateSlider2Low:SetText("0%"); 
				PowaOptionsTimerUpdateSlider2High:SetText("100%");
			  </OnLoad>
			  <OnValueChanged>PowaAuras:PowaOptionsTimerUpdateSliderChanged2(self);</OnValueChanged>
			</Scripts>
		  </Slider>

		  
		  			
			<!-- User Texture Count -->
			<CheckButton name="PowaOverrideTextureCountButton" inherits="PowaCheckTemplate">
				<Size>
					<AbsDimension x="25" y="25"/>
				</Size>
				<Anchors>
			  <Anchor point="TOPLEFT"
					  relativeTo="PowaOptionsTimerUpdateSlider2"
					  relativePoint="BOTTOMLEFT">
				<Offset>
				  <AbsDimension x="0"
								y="-20" />
				</Offset>
			  </Anchor>
			</Anchors>
				<Scripts>
					<OnLoad>
						self.tooltipText = PowaAuras.Text.aideOverrideTextureCount;
						PowaOverrideTextureCountButtonText:SetText(PowaAuras.Text.nomOverrideTextureCount);
					</OnLoad>
					<OnClick>
						PowaAuras:MiscChecked(self, "OverrideMaxTextures");
					</OnClick>
				</Scripts>
			</CheckButton>
			
			<!-- Number of Aura Textures -->
		  <Slider name="PowaOptionsTextureCount"
				  inherits="PowaBarSliderTemplateWithButtons">
			<Size>
			  <AbsDimension x="550"
							y="16" />
			</Size>
			<Anchors>
			  <Anchor point="TOPLEFT"
					  relativeTo="PowaOverrideTextureCountButton"
					  relativePoint="BOTTOMLEFT">
				<Offset>
				  <AbsDimension x="25"
								y="-10" />
				</Offset>
			  </Anchor>
			</Anchors>
			<Scripts>
			  <OnLoad>
				self:SetMinMaxValues(10,500);
				self:SetValue(PowaMisc.UserSetMaxTextures);
				self:SetValueStep(1);
				self.aide = aideTextureCount;
				PowaOptionsTextureCountText:SetText(PowaAuras.Text.nomTextureCount.." : "..self:GetValue());
				PowaOptionsTextureCountLow:SetText("10"); 
				PowaOptionsTextureCountHigh:SetText("500");
			  </OnLoad>
			  <OnValueChanged>PowaAuras:PowaOptionsMaxTexturesSliderChanged(self);</OnValueChanged>
 			</Scripts>
		  </Slider>
	  
		  <Button name="PowaShowAuraBrowserButton" inherits="OptionsButtonTemplate" text="Show Browser">
			<Size>
			  <AbsDimension x="160"
							y="22" />
			</Size>
				<Anchors>
					<Anchor point="TOPLEFT" relativeTo="PowaOptionsTextureCount" relativePoint="BOTTOMLEFT">
						<Offset>
							<AbsDimension x="0" y="-20"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						PowaShowAuraBrowserButtonText:SetText(PowaAuras.Text.nomPowaShowAuraBrowser);
					</OnLoad>
					<OnClick>
						PowaAuras:MainOptionShow();
					</OnClick>
				</Scripts>
			</Button>
		  
		  <Button name="PowaResetPositionButton" inherits="OptionsButtonTemplate" text="Reset Editor">
			<Size>
			  <AbsDimension x="160"
							y="22" />
			</Size>
				<Anchors>
					<Anchor point="BOTTOMLEFT" relativeTo="PowaShowAuraBrowserButton" relativePoint="BOTTOMRIGHT">
						<Offset>
							<AbsDimension x="30" y="0"/>
						</Offset>
					</Anchor>
				</Anchors>
				<Scripts>
					<OnLoad>
						PowaResetPositionButtonText:SetText(PowaAuras.Text.nomReset);
					</OnLoad>
					<OnClick>
						PowaAuras:ResetPositions();
						PowaAuras:MainOptionShow();
					</OnClick>
				</Scripts>
			</Button>
		  
              <Frame name="PowaDropDownDefaultTimerTexture"
                     inherits="UIDropDownMenuTemplate">
                <Size>
                  <AbsDimension x="240" />
                </Size>
                <Anchors>
                  <Anchor point="TOPLEFT"
                          relativeTo="PowaShowAuraBrowserButton"
                          relativePoint="BOTTOMLEFT">
                    <Offset>
                      <AbsDimension x="-10"
                                    y="-25" />
                    </Offset>
                  </Anchor>
                </Anchors>
                <Layers>
                  <Layer level="BACKGROUND">
                    <FontString name="$parentLabel"
                                inherits="GameFontNormalSmall">
                      <Anchors>
                        <Anchor point="BOTTOMLEFT"
                                relativePoint="TOPLEFT">
                          <Offset>
                            <AbsDimension x="21"
                                          y="5" />
                          </Offset>
                        </Anchor>
                      </Anchors>
                    </FontString>
                  </Layer>
                </Layers>
                <Scripts>
                  <OnLoad>
                  	PowaDropDownDefaultTimerTextureLabel:SetText(PowaAuras.Text.nomDefaultTimerTexture); 
                   </OnLoad>
                   <OnShow>
                  	UIDropDownMenu_Initialize(self, PowaAuras.DropDownDefaultTimerMenu_Initialize);
                  </OnShow>
                  <OnEnter>GameTooltip:SetOwner(self, "ANCHOR_RIGHT");</OnEnter>
                  <OnLeave>GameTooltip:Hide();</OnLeave>
                </Scripts>
              </Frame>		  
		  
              <Frame name="PowaDropDownDefaultStacksTexture"
                     inherits="UIDropDownMenuTemplate">
                <Size>
                  <AbsDimension x="260" />
                </Size>
                <Anchors>
                  <Anchor point="TOPLEFT"
                          relativeTo="PowaResetPositionButton"
                          relativePoint="BOTTOMLEFT">
                    <Offset>
                      <AbsDimension x="10"
                                    y="-25" />
                    </Offset>
                  </Anchor>
                </Anchors>
                <Layers>
                  <Layer level="BACKGROUND">
                    <FontString name="$parentLabel"
                                inherits="GameFontNormalSmall">
                      <Anchors>
                        <Anchor point="BOTTOMLEFT"
                                relativePoint="TOPLEFT">
                          <Offset>
                            <AbsDimension x="21"
                                          y="5" />
                          </Offset>
                        </Anchor>
                      </Anchors>
                    </FontString>
                  </Layer>
                </Layers>
                <Scripts>
                  <OnLoad>
                  	PowaDropDownDefaultStacksTextureLabel:SetText(PowaAuras.Text.nomDefaultStacksTexture); 
                   </OnLoad>
                   <OnShow>
                  	UIDropDownMenu_Initialize(self, PowaAuras.DropDownDefaultStacksMenu_Initialize);
                  </OnShow>
                  <OnEnter>GameTooltip:SetOwner(self, "ANCHOR_RIGHT");</OnEnter>
                  <OnLeave>GameTooltip:Hide();</OnLeave>
                </Scripts>
              </Frame>

			  
              <EditBox name="PowaCustomSoundPath"
                       autoFocus="false"
                       inherits="InputBoxTemplate">
                <Size>
                  <AbsDimension x="580"
                                y="16" />
                </Size>
                <Anchors>
                  <Anchor point="TOPLEFT"
                          relativeTo="PowaDropDownDefaultTimerTexture"
                          relativePoint="BOTTOMLEFT">
                    <Offset>
                      <AbsDimension x="-20"
                                    y="-15" />
                    </Offset>
                  </Anchor>
                </Anchors>
                <Layers>
                  <Layer level="OVERLAY">
                    <FontString inherits="ChatFontNormal"
                                bytes="200" />
                  </Layer>
                </Layers>
                <Scripts>
                  <OnLoad>PowaCustomSoundPathText:SetText(PowaAuras.Text.nomCustomSoundPath); self.aide = PowaAuras.Text.aideCustomSoundPath;</OnLoad>
                  <OnEnterPressed>self:ClearFocus()</OnEnterPressed>
                  <OnEnter>GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); GameTooltip:SetText(self.aide, nil, nil, nil, nil, 1);</OnEnter>
                  <OnLeave>GameTooltip:Hide();</OnLeave>
                </Scripts>
                <Layers>
                  <Layer level="OVERLAY">
                    <FontString name="$parentText"
                                inherits="GameFontNormalSmall"
                                justifyH="LEFT">
                      <Size>
                        <AbsDimension x="220"
                                      y="20" />
                      </Size>
                      <Anchors>
                        <Anchor point="BOTTOMLEFT"
                                relativeTo="$parent"
                                relativePoint="TOPLEFT">
                          <Offset>
                            <AbsDimension x="0"
                                          y="0" />
                          </Offset>
                        </Anchor>
                      </Anchors>
                    </FontString>
                  </Layer>
                </Layers>
              </EditBox>
			  
              <EditBox name="PowaCustomAuraPath"
                       autoFocus="false" justifyH="LEFT"
                       inherits="InputBoxTemplate">
                <Size>
                  <AbsDimension x="580"
                                y="16" />
                </Size>
                <Anchors>
                  <Anchor point="TOPLEFT"
                          relativeTo="PowaCustomSoundPath"
                          relativePoint="BOTTOMLEFT">
                    <Offset>
                      <AbsDimension x="0"
                                    y="-20" />
                    </Offset>
                  </Anchor>
                </Anchors>
                <Layers>
                  <Layer level="OVERLAY">
                    <FontString inherits="ChatFontNormal"
                                bytes="200" />
                  </Layer>
                </Layers>
                <Scripts>
                  <OnLoad>PowaCustomAuraPathText:SetText(PowaAuras.Text.nomCustomAuraPath); self.aide = PowaAuras.Text.aideCustomAuraPath;</OnLoad>
                  <OnEnterPressed>self:ClearFocus()</OnEnterPressed>
                  <OnEnter>GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); GameTooltip:SetText(self.aide, nil, nil, nil, nil, 1);</OnEnter>
                  <OnLeave>GameTooltip:Hide();</OnLeave>
                </Scripts>
                <Layers>
                  <Layer level="OVERLAY">
                    <FontString name="$parentText"
                                inherits="GameFontNormalSmall"
                                justifyH="LEFT">
                      <Size>
                        <AbsDimension x="220"
                                      y="20" />
                      </Size>
                      <Anchors>
                        <Anchor point="BOTTOMLEFT"
                                relativeTo="$parent"
                                relativePoint="TOPLEFT">
                          <Offset>
                            <AbsDimension x="0"
                                          y="0" />
                          </Offset>
                        </Anchor>
                      </Anchors>
                    </FontString>
                  </Layer>
                </Layers>
              </EditBox>			  
			
		</Frames>
    </Frame>

</Ui>
